package com.example.springboot_06_blog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.springboot_06_blog.mapper.UserMapper;
import com.example.springboot_06_blog.pojo.User;
import com.example.springboot_06_blog.service.IUserService;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @auther cangshufeilun
 * @date 2022/4/1 16:58
 */
@Service
public class UserServicelmpl extends ServiceImpl<UserMapper, User> implements IUserService{

    @Autowired
    private UserMapper userMapper;


    @Override
    public User login(String username, String password) {

        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username",username);
        queryWrapper.eq("password",password);

        return userMapper.selectOne(queryWrapper);
    }
}
